import request from '@/utils/request'
import {
	getItem
} from '@/utils/storage.js'

// 个人中心
export function userInfo(data) {
	return request({
		url: 'api/user/index',
		method: 'post',
		data
	})
}

// 添加意见
export function addFeedback(data) {
	return request({
		url: 'api/user/add_feedback',
		method: 'post',
		data
	})
}

// 院级部门
export function yuanjiList(data) {
	return request({
		url: 'api/user/yuanji',
		method: 'post',
		data
	})
}

// 院级部门
export function bumenList(data) {
	return request({
		url: 'api/user/bumen',
		method: 'post',
		data
	})
}


// 部门信息
export function bumenInfo(data) {
	return request({
		url: 'api/user/bumen_info',
		method: 'post',
		data
	})
}


// 部门信息
export function bumenUserPage(data) {
	return request({
		url: 'api/user/bumen_user',
		method: 'post',
		data
	})
}



// 用户所属部门
export function userDepartment(data) {
	return request({
		url: 'api/user/user_department',
		method: 'post',
		data
	})
}

// 用户权限设置
export function userRules(data) {
	return request({
		url: '/api/user/user_rules',
		method: 'post',
		data
	})
}


//添加用户
export function addUser(data) {
	return request({
		url: 'api/user/add_user',
		method: 'post',
		data
	})
}

//提交人审核
export function examineSub(data) {
	return request({
		url: '/api/user/examine_sub',
		method: 'post',
		data
	})
}

//添加院
export function addYuan(data) {
	return request({
		url: 'api/user/add_yuan',
		method: 'post',
		data
	})
}

//添加部门
export function addBumen(data) {
	return request({
		url: 'api/user/add_bumen',
		method: 'post',
		data
	})
}

//审核管理 (审核员)
export function examineUser(data) {
	return request({
		url: 'api/user/examine_user',
		method: 'post',
		data
	})
}

//审核管理 (审核员) (通过)
export function examineDrill(data) {
	return request({
		url: 'api/user/examine_drill',
		method: 'post',
		data
	})
}

//审核管理 (审核员) (驳回)
export function rejectDrill(data) {
	return request({
		url: 'api/user/reject_drill',
		method: 'post',
		data
	})
}

//按钮权限
export function userRule(type) {
	return request({
		url: 'api/user/rule',
		method: 'post',
		data: {
			token: getItem('token'),
			type
		}
	})
}


//按钮权限
export function userInfos(data) {
	return request({
		url: 'api/user/user_info',
		method: 'post',
		data
	})
}

//审核员和提交员权限
export function auditManagement(data) {
	return request({
		url: 'api/user/audit_management',
		method: 'post',
		data
	})
}

//修改个人信息
export function editUserInfo(data) {
	return request({
		url: '/api/user/edit_user_info',
		method: 'post',
		data
	})
}

//选择权限
export function userGroupList() {
	return request({
		url: 'api/user/user_group_list',
		method: 'post',
		data: {
			token: getItem('token')
		}
	})
}

//选择权限
export function editUserRules(data) {
	return request({
		url: 'api/user/edit_user_rules',
		method: 'post',
		data
	})
}
//选择权限(删除)
//按钮权限
export function userRuleDel(data) {
	return request({
		url: 'api/user/del_user',
		method: 'post',
		data: {
			id: data.del_user,
			token: getItem('token')
		}
	})
}
//流程图列表
export function flowChartList(data) {
	return request({
		url: 'api/user/flow_chart_list',
		method: 'post',
		data: {
			token: getItem('token'),
			data_category: data,
		}
	})
}

//流程图
export function flowChart(hid, data_category) {
	return request({
		url: 'api/user/flow_chart',
		method: 'post',
		data: {
			token: getItem('token'),
			hid,
			data_category
		}
	})
}
